const Index = {
	// 深拷贝
	copy(data){ return typeof data === 'object' ? JSON.parse(JSON.stringify(data)) : data },
	//
	deepCopy(obj){
		const deep = function(obj){
			let clone = Array.isArray(obj) ? [] : {}
			if (obj && typeof obj === 'object') {
				for (let i in obj) {
					if (obj.hasOwnProperty(i)) {
						if (obj[i] && typeof obj[i] === 'object') {
							clone[i] = deep(obj[i])
						} else {
							clone[i] = obj[i]
						}
					}
				}
			}
			return clone
		}
		return deep(obj)
	},
}
export default Index